<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<script src="../dist/pear-downloader.js"></script>
<!--<script src="https://cdn.jsdelivr.net/npm/peardownloader@latest"></script>-->
<body>


<script type="">
    function downloading(obj) {
        document.getElementById('filename').innerHTML = obj.fileName;
        document.getElementById('progress').innerHTML =(obj.progress * 100).toFixed(1) + '%';
        document.getElementById('status').innerHTML = obj.status;
        document.getElementById('speed').innerHTML = Math.round(obj.speed) + 'KB/s';
        document.getElementById('p2pRatio').innerHTML = (obj.p2pRatio * 100).toFixed(1) + '%';
    }
</script>



<pear-downloader style="color: red;" onProgress="downloading(this)"  data-token=""   data-auto-download="true"
                 data-src="https://qq.webrtc.win/tv/Pear-Demo-Yosemite_National_Park.mp4" >点击下载
</pear-downloader>



<br /><br />
<div> 文件名： <span id="filename"></span></div>
<div> 状态： <span id="status"></span></div>
<div> 进度： <span id="progress"></span></div>
<div> 速度： <span id="speed"></span></div>
<div> P2P率： <span id="p2pRatio"></span></div>

</body>
</html>